Developing an ionic Edge by Keith D. Moore Robin van Baalen Anton Shevchenko Diego Netto Alan Levicki Chris Marshall

Developing an ionic Edge by Keith D. Moore Robin van Baalen Anton Shevchenko Diego Netto Alan Levicki Chris Marshall

Author:Keith D. Moore, Robin van Baalen, Anton Shevchenko, Diego Netto, Alan Levicki, Chris Marshall
Language: eng
Format: epub
Publisher: Bleeding Edge Press
Published: 2014-11-17T05:00:00+00:00


The future of AngularJS application routing

Please note that this book was written and the companion app Trendicity was built when AngularJS 1.3 was just recently released. For the future AngularJS 2.0, a new router is being developed that is also backported to AngularJS 1.3. Similar to Angular UI Router, the new router is also based on (nestable) states. However, it is up to Drifty to incorporate support for that router in Ionic.

Setting up the application routes

Aside from some one-time setup logic, the app.js file (which can be found in www/js/app.js) contains all of the application’s routing logic as well. This logic is defined using the aforementioned UI Router component and its $stateProvider and $urlRouterProvider providers.

First, let us take a look at the complete routing setup as it is used in Trendicity.

// ... app.js configuration code above .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('app', { url: '/app', abstract: true, templateUrl: 'templates/menu.html', controller: 'AppCtrl' }) .state('app.intro', { url: '/intro', views: { 'menuContent': { templateUrl: 'templates/intro.html', controller: 'IntroCtrl' } } }) .state('app.favorites', { url: '/favorites', views: { 'menuContent': { templateUrl: 'templates/favorites.html', controller: 'FavoritesCtrl' } } }) .state('app.home', { url: '/home', abstract: true, views: { 'menuContent': { templateUrl: 'templates/home.html', controller: 'HomeCtrl' } } }) .state('app.home.map', { url: '/map/?latitude&longitude', views: { 'tab-map': { templateUrl: 'templates/tab-map.html', controller: 'MapViewCtrl as mapCtrl' } } }) .state('app.home.card', { url: '/card', views: { 'tab-card': { templateUrl: 'templates/tab-card.html', controller: 'CardViewCtrl' } } }) .state('app.home.list', { url: '/list', views: { 'tab-list': { templateUrl: 'templates/tab-list.html', controller: 'ListViewCtrl' } } }); // if none of the above states are matched, use this as the fallback $urlRouterProvider.otherwise('/app/home/map/'); }) // ... app.js continues here



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(56047)
What's Done in Darkness by Kayla Perrin(26605)
The Fifty Shades Trilogy & Grey by E L James(19087)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19073)
Shot Through the Heart by Mercy Celeste(18944)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(17125)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(17006)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(16886)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16835)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16459)
The Subtle Art of Not Giving a F*ck by Mark Manson(14365)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(14151)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(13656)
Scorched Earth by Nick Kyme(12779)
Drei Generationen auf dem Jakobsweg by Stein Pia(10972)
Suna by Ziefle Pia(10895)
Scythe by Neal Shusterman(10353)
The Ultimate Python Exercise Book: 700 Practical Exercises for Beginners with Quiz Questions by Copy(9910)
D:\Jan\FTP\HOL\Work\Alien Breed - Tower Assault CD32 Alien Breed II - The Horror Continues Manual 1.jpg by PDFCreator(9882)
De Souza H. Master the Age of Artificial Intelligences. The Basic Guide...2024 by Unknown(9860)